package com.verisette.ncos.service.master.bizunit;

import java.util.List;

import org.apache.log4j.Logger;

import org.corp.agi.common.exception.ProcessException;
import org.corp.agi.service.bean.ProcessContext;
import org.corp.agi.service.bizunit.CommonBusinessUnit;
import com.verisette.ncos.persistence.domain.MasterUserGroup;

public class ViewUserGroupBU extends CommonBusinessUnit {

	private Logger logger = Logger.getLogger(ViewUserProfileManagementBU.class);
	
	@Override
	public void execute(ProcessContext processContext) throws ProcessException {
		if(logger.isInfoEnabled()) logger.info( this.getClass().getSimpleName() + ": execute" );
		
		MasterUserGroup userGroup = (MasterUserGroup)processContext.getValueObject();
		
		// View UserGroup
		logger.debug("1.View UserGroup");
		logger.debug("--> userGroupId : " + userGroup.getUsgId());
		
		userGroup = (MasterUserGroup)commonDAO.findById(MasterUserGroup.class, userGroup.getUsgId());
		
		if(userGroup != null){
			logger.debug("--> Found user group !!! userGroupName: " + userGroup.getUsgName());
			
		}else{
			logger.debug("--> Not found user group !!! userGroupName: ");
			
		}
		
		processContext.setValueObject(userGroup);
		
	}

}
